import { createApp } from 'vue'
import App from './App.vue'
//导入全局样式
import './assets/index.css'

//导入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'

//axios
import axios from 'axios'
import VueAxios from 'vue-axios'

//路由
import { createRouter, createWebHashHistory } from 'vue-router'

const Maxios = axios.create({
    baseURL:'https://autumnfish.cn/',
    timeout:5000
})

import discovery from './views/01.discovery.vue'
import playlists from './views/02.playlists'
import songs from './views/03.songs'
import mvs from './views/04.mvs'
import result from './views/05.result'
import playlist from './views/06.playlist'
import mv from './views/07.mv'

const routes =[
        {
            path:'/',
            redirect:'/discovery'
        },
        {
              // 发现音乐
            path:'/discovery',
            component:discovery
        },
        {
            // 推荐歌单
            path:'/playlists',
           component:playlists
        },
        {
            path:'/playlist',
            component:playlist
        },
        {
            //最新音乐
            path:'/songs',
            component:songs
        },
        {
            //搜索结果页
            path:'/result',
            component:result
        },
        {
            //mv页
            path:'/mv',
            component:mv
        },
        {
            path:'/mvs',
            component:mvs
        }
    ]
const router =createRouter({
    history:createWebHashHistory(),
    routes
})
export default routes


const app = createApp(App)

app.use(router).use(ElementPlus)
.use(VueAxios,Maxios).mount('#app');
import moment from 'moment'
app.config.globalProperties.$moment = moment;

